# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mfsniffer
pkgver=0.1
pkgrel=7
groups=('blackarch' 'blackarch-sniffer')
pkgdesc='A python script for capturing unencrypted TSO login credentials. '
arch=('any')
url='http://packetstormsecurity.com/files/120802/MF-Sniffer-TN3270-Password-Grabber.html'
license=('custom:unknown')
depends=('python2' 'python2-scapy')
makedepends=('unzip')
source=("https://dl.packetstormsecurity.net/sniffers/MFSniff.zip")
sha512sums=('278b11d2e0fa53d15375f2eb3a4dd5eb6798594e3110a5477c932e1fb04ad06e80e679d093544b2dabe0ef2285480880e6dca55958fe18c321a809ea12235344')

prepare() {
  cd MFSniffer

  sed -i 's|/usr/bin/env python|/usr/bin/env python2|' MFSniffer.py
}

package() {
  cd MFSniffer

  install -Dm 755 MFSniffer.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 MFSniffer-Screenshot.png \
    "$pkgdir/usr/share/mfsniffer/MFSniffer-Screenshot.png"
  install -m 644 file_id.diz "$pkgdir/usr/share/$pkgname/file_id.diz"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

